package com.ymm.spark.dao.impl;

import com.ymm.spark.config.JdbcHelper;
import com.ymm.spark.dao.ITop10CategoryDAO;
import com.ymm.spark.domain.Top10Category;

/**
 * @author zhangj
 * @date 2019/11/6
 */
public class ITop10CategoryDAOImpl implements ITop10CategoryDAO {

	/**
	 * 插入top10品类
	 *
	 * @param category
	 */
	@Override
	public void insert(Top10Category category) {
		String sql = "insert into top10_category values(?,?,?,?,?)";

		Object[] params = new Object[]{category.getTaskid(),
				category.getCategoryid(),
				category.getClickCount(),
				category.getOrderCount(),
				category.getPayCount()};

		JdbcHelper jdbcHelper = JdbcHelper.getInstance();
		jdbcHelper.executeUpdate(sql, params);
	}
}
